home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 5-7 / Prograph Reference 5-7.rsrc / TEXT_161.txt < prev    next >
Encoding:
Text File  |  1995-10-25  |  5.1 KB  |  192 lines

  1.  
  2. Graphics
  3.  
  4. Graphics operations normally occur in a Canvas window item. Most graphics in Prograph rely on Macintosh Toolbox calls; see chapter 7, ‚ÄúThe Macintosh Toolbox.‚Äù 
  5. Some primitives are provided, however, to simplify certain common tasks. Many of these primitives use the Macintosh types Point and Rect, which have textual representations in Prograph as {<vertical> <horizontal>} and {<top> <left> <bottom> <right>} respectively. 
  6.  
  7.  
  8. _________________________________________________
  9.  
  10.                                                                drag-rect      *276*
  11.  
  12.  
  13. Input types: Canvas; Rect; Point; MacConstant
  14.  
  15. Output types: Rect
  16.  
  17. Description:     Drags a dotted outline of OldRect within aCanvas following the movement of the mouse, until the mouse button is released, when the outlined rectangle becomes NewRect. The value of Mouse must be within the bounds of OldRect.  Restrict must be one of noConstraint, hAxisOnly, or vAxisOnly, which respectively indicate that dragging is unrestricted, horizontal, or vertical. 
  18.  
  19. Note: drag-rect does its own calls to begin-drawing and end-drawing, so it should be called outside the user‚Äôs calls to those routines.
  20.  
  21. See also:  grow-rect
  22.  
  23.  
  24. _________________________________________________
  25.  
  26.                                                          find-bounds    *276*
  27.  
  28.  
  29.  
  30. Input names: aList;  AttributeName;  aPoint;  [StartIndex]
  31.  
  32. Input types: list;  string;  Point;  [integer]
  33.  
  34. Defaults: StartIndex = 1
  35.  
  36. Output names: FoundIndex;  Instance
  37.  
  38. Output types: integer;  <any class> | null
  39.  
  40. Description:     Instance is the first instance after position StartIndex in aList with an attribute AttributeName, the value of which is a rectangle containing aPoint. FoundIndex is the position of Instance in aList. If no such instance exists, FoundIndex and Instance are 0 and NULL respectively. 
  41.  
  42. See also:  find-instance
  43.  
  44.  
  45. _________________________________________________
  46.  
  47.                                                                                 grow-rect     *277*
  48.  
  49.  
  50.  
  51. Input types: Canvas;  Rect;  Point;  MacConstant
  52.  
  53. Output types: Rect
  54.  
  55. Description:     Produces a modified dotted outline of OldRect within aCanvas following the movement of the mouse, until the mouse button is released, when the outlined rectangle becomes NewRect. The value of Mouse must be within the bounds of OldRect.  Restrict must be one of noConstraint, hAxisOnly, or vAxisOnly, which indicate respectively that resizing is unrestricted, horizontal, or vertical.
  56.  
  57. Note: grow-rect does its own calls to begin-drawing and end-drawing, so it should be called outside the user‚Äôs calls to those routines.
  58.  
  59. See also:  drag-rect
  60.  
  61.  
  62. _________________________________________________
  63.  
  64.                                       ints-to-point    *277*
  65.  
  66.  
  67.  
  68. Input types: integer;  integer
  69.  
  70. Output types: Point
  71.  
  72. Description:     APoint is the point {Vertical Horizontal}.
  73.  
  74. See also:  point-to-ints, ints-to-rect
  75.  
  76.  
  77. _________________________________________________
  78.  
  79.                                                                ints-to-rect     *278*
  80.  
  81.  
  82.  
  83. Input types: integer;  integer;  integer;  integer
  84.  
  85. Output types: Rect
  86.  
  87. Description:     ARect is the rectangle {Top Left Bottom  Right}.
  88.  
  89. See also:  rect-to-ints, ints-to-point
  90.  
  91.  
  92. _________________________________________________
  93.  
  94.                                       ints-to-rgb     *278*
  95.  
  96.  
  97.  
  98. Input types: integer;  integer;  integer; 
  99.  
  100. Output types: RGBColor
  101.  
  102. Description:     Takes Red, Green, and Blue values and converts them to an RGBColor.
  103.  
  104. See also:  rgb-to-ints
  105.  
  106.  
  107. _________________________________________________
  108.  
  109.                                        point-to-ints    *278*
  110.  
  111.  
  112.  
  113. Input types: Point
  114.  
  115. Output types: integer;  integer
  116.  
  117. Description:     Vertical and Horizontal are the vertical and horizontal coordinates of aPoint, respectively.
  118.  
  119. See also:  ints-to-point, points-to-rect
  120.  
  121.  
  122. _________________________________________________
  123.  
  124.                                               points-to-rect    *279*
  125.  
  126.  
  127.  
  128. Input types: Point;  Point
  129.  
  130. Output types: Rect
  131.  
  132. Description:     ARect is the rectangle, the top left and bottom right corners of which are the points TopLeft and BottomRight, respectively.
  133.  
  134. Example:    A framed rectangle.
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145. See also:  rect-to-points, point-to-ints
  146.  
  147.  
  148. _________________________________________________
  149.  
  150.                                                                rect-to-ints     *279*
  151.  
  152.  
  153.  
  154.  
  155. Input types: Rect
  156.  
  157. Output types: integer;  integer;  integer;  integer
  158.  
  159. Description:     Top, Left, Bottom, Right are respectively the coordinates of the top, left, bottom, and right of aRect.
  160.  
  161. See also:  ints-to-rect, rect-to-points
  162.  
  163.  
  164. _________________________________________________
  165.  
  166.                                                 rect-to-points    *280*
  167.  
  168.  
  169.  
  170. Input types: Rect
  171.  
  172. Output types: Point;  Point
  173.  
  174. Description:     TopLeft and BottomRight are the points at the top left and bottom right corners of aRect, respectively.
  175.  
  176. See also:  points-to-rect, rect-to-ints
  177.  
  178.  
  179. _________________________________________________
  180.  
  181.                                           rgb-to-ints     *280*
  182.  
  183.  
  184.  
  185. Input types: RGBColor 
  186.  
  187. Output types: integer;  integer;  integer
  188.  
  189. Description:     Takes an RGBColor and converts it to corresponding Red, Green, and Blue values.
  190.  
  191. See also:  ints-to-rgb
  192.